<div>
	<div class="article-list span8">
		<?php 
		if (!is_array($this->getData('list'))) {
			__($this->getData('list'));
			debug_print_backtrace();
			exit;
		}
		?>
		<?php foreach ($this->getData('list') as $a) {
			if (!$a->cando($a::OP_READ, \App::getCurrentUser())) {
				continue;
			}
			$status = '';
			if ($a->getStatusId() == $a::DELETED) {
				$status = ' deleted';
			}
			if ($a->getStatusId() == $a::HIDDEN) {
				$status = ' hidden';
			}
			?>
			<div class="article<?=$status?>">
				<div class="date"><?=$a->getCreated()?></div>
				<h1 class="title"><a href="/<?=$this->T('articles', 'Path')?>/<?=$this->T('view', 'Path')?>/<?=$a->getContent()->getPath()?>"><?=$a->getContent()->getTitle()?></a></h1>
				<div class="author"><?=$a->getAuthor()->getName()?></div>
                <?php if ($a->haveAlbum() && $a->getAlbum()) {
                    $c = $a->getAlbum()->getCover();
                    $i = $c->getImage(500)
                    ?>
                    <div class="banner">
                        <img class="img-polaroid" src="<?=$i->source?>" />
                    </div>
                <?php } ?>
				<div class="annotation"><![CDATA[ <?=$a->getContent()->getAnnotation()?> ]]></div>
				<div class="continue"><a href="/<?=$this->T('articles', 'Path')?>/<?=$this->T('view', 'Path')?>/<?=$a->getContent()->getPath()?>"><?=$this->T('Continue reading')?></a></div>
				<?php if ($a->cando($a::OP_WRITE, \App::getCurrentUser())) { ?>
					<widget class="Tools"
						edit="/article/edit/<?=$a->getId()?>"
						remove="/article/remove/<?=$a->getId()?>"
						/>
				<?php } ?>
			</div>
		<?php }?>
<?php

if ($this->getData('pages') > 1) {
	$pages = $this->getData('pages'); 
	$page = $this->getData('page');
	
	$prev = $page - 1;
	$next = $page + 1;
?>
	<hr />

		<div class="pagination pagination-centered">
            <ul>
                <li<?=($prev == 0) ? ' class="disabled"': '' ?>><a href="<?=$prev  > 0 ? "/{$this->T('articles', 'Path')}/index/{$prev}" : "#" ?>">&lt;&lt;</a></li>
                <?php for ($i=0; $i<$pages; $i++) {?>
                <li<?=($i+1 == $page) ? ' class="active"': '' ?>><a href="/<?=$this->T('articles', 'Path')?>/index/<?=$i+1?>"><?=$i+1?></a></li>
                <?php }?>
                <li<?=($next > $pages) ? ' class="disabled"' : '' ?>><a href="<?=$next <= $pages ? "/{$this->T('articles', 'Path')}/index/{$next}" : "#" ?>">&gt;&gt;</a></li>
            </ul>
		</div>
<?php }?>

	</div>
	<div class="span1"></div>
	<div class="span3 article">
		<div class="date"> - </div>
		<h1><?=$this->T('Join our page')?>!</h1>
		<a href="http://www.facebook.com/OzoTeniss"><div class="banner-fb1"></div></a>
	</div>
</div>